<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('会议室信息新增及修改')" />
    <style type="text/css">
        .layui-input, .layui-textarea{width:calc(100% - 100px);}
        .layui-form-label{width:180px}
        .layui-form-select dl{margin-left:80px;min-width: calc(100% - 100px);}
        .layui-edge{margin-right:28px;}
    </style>
</head>
<body>
<form class="layui-form" id="form" style="margin: 16px 84px 16px 25px;">
	<input type="hidden" id="guid" name="guid"  th:value="${meetingRoom?.guid}">
	<div class="layui-form-item">
        <label class="layui-form-label"><font class="f_red">*</font>序号：</label>
        <div class="layui-input-block">
            <input type="text" name="iid" id="iid" th:value="${meetingRoom?.iid}" lay-verify="required" autocomplete="off" placeholder="请输入" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><font class="f_red">*</font>会议室名称：</label>
        <div class="layui-input-block">
            <input type="text" name="vHysMc" id="vHysMc" th:value="${meetingRoom?.vHysMc}" lay-verify="required" autocomplete="off" placeholder="请输入" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><font class="f_red">*</font>会议室位置：</label>
        <div class="layui-input-block">
            <input type="text" name="vHysWz" id="vHysWz" th:value="${meetingRoom?.vHysWz}" lay-verify="required" autocomplete="off" placeholder="请输入" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><font class="f_red">*</font>会议室设备：</label>   
        <div class="layui-input-block">
        	<input type="text" name="vHysSb" id="vHysSb" th:value="${meetingRoom?.vHysSb}" lay-verify="required" autocomplete="off" placeholder="请输入" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><font class="f_red">*</font>最大可容纳人数：</label>
        <div class="layui-input-block">
            <input type="text" name="fMaxRs" id="fMaxRs" th:value="${meetingRoom?.fMaxRs}" lay-verify="required" autocomplete="off" placeholder="请输入" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item layui-hide">
        <input type="button" lay-submit="" lay-filter="btn_save" id="btn_save" value="保存">
    </div>
</form>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    /*<![CDATA[*/
    var prefix = ctx + "oa/meetingroom";
    /*]]>*/
</script>
<script>
var $,layer,form;
layui.use(['form','layer','jquery'], function () {
    $ = layui.$,layer = layui.layer,form = layui.form;
});
//提交调用的方法
function submitHandler() {
	if($('#guid').val()){//通过判断guid是否存在来判断是新增还是保存
		if ($.validate.form()) {
            $.operate.save(prefix + "/editpost", {'meetingRoomItems':JSON.stringify([$.common.formToJSON('form')])});
        }
	}else{
		if ($.validate.form()) {
			$.operate.save(prefix + "/addpost", {'meetingRoomItems':JSON.stringify([$.common.formToJSON('form')])});
		}
	}
}
</script>
</body>
</html>
